package com.macro.mall.portal.controller;

import com.macro.mall.common.api.CommonPage;
import com.macro.mall.common.api.CommonResult;
import com.macro.mall.model.BmsRecruitmentInformation;
import com.macro.mall.portal.dto.BmsRecruitmentInformationParam;
import com.macro.mall.portal.service.BmsRecruitmentInformationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

/**
 * 招聘信息ontroller
 * Created by macro on 2018/4/26.
 */
@Controller
@Api(tags = "BmsRecruitmentInformationController")
@Tag(name = "BmsRecruitmentInformationController", description = "招募信息管理")
@RequestMapping("/informationMp")
public class BmsRecruitmentInformationController {
    @Autowired
    private BmsRecruitmentInformationService bmsRecruitmentInformationService;



    @ApiOperation("分页查询招募信息")
    @RequestMapping(value = "/list", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<CommonPage<BmsRecruitmentInformation>> getList(@RequestBody BmsRecruitmentInformationParam bmsRecruitmentInformationParam) {
        List<BmsRecruitmentInformation> bmsRecruitmentInformationList = bmsRecruitmentInformationService.getList(bmsRecruitmentInformationParam);
        return CommonResult.success(CommonPage.restPage(bmsRecruitmentInformationList));
    }
    @ApiOperation("根据id获取招募详细信息信息")
    @RequestMapping(value = "/detail", method = RequestMethod.POST)
    @ResponseBody
    public CommonResult<BmsRecruitmentInformation> getItem(@RequestBody BmsRecruitmentInformationParam bmsRecruitmentInformationParam,HttpServletRequest request) {
        BmsRecruitmentInformation bmsRecruitmentInformation = bmsRecruitmentInformationService.getDetail(bmsRecruitmentInformationParam,request);
        return CommonResult.success(bmsRecruitmentInformation);
    }



}
